package com.warehouse.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 新增加一个类用来添加虚拟路径映射
 * @author 卓汉杰
 */

@Configuration
public class MyPicConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
       registry.addResourceHandler("/images/**").addResourceLocations("file:C:/Users/DELL/Desktop/warehouse/src/main/resources/static/images/");
//       registry.addResourceHandler("/images/**").addResourceLocations("file:/myjava/images/");
//        registry.addResourceHandler("/font/**").addResourceLocations("file:/myjava/font/");
    }

    @Bean

    public PaginationInterceptor paginationInterceptor() {

        return new PaginationInterceptor();

    }
}